<template>
  <div>
    <div class="top-box">
      <!-- 后台顶部 -->
      <div class="top-img">
        <img src="../../assets/image/tingyu-1.jpg" alt="" />
      </div>
      <div class="top-title"><p>ting域 主持人团队 后台管理</p></div>
      <!-- <div class="top-login">登录</div> -->
      <div class="top-login">
          <span v-if="isLogin"
            ><a href="http://localhost:8080/#/loginback" style="color:black">登录</a>
          </span>
          <span v-if="isCenter" class="userCenter"
            ><span style="color: black" >个人中心</span>
            <span class="user">{{ username }}</span>
          </span>
        </div>
    </div>
    
  </div>
</template>

<script>

import { mapState } from "vuex";

export default {
  name: "BackNav",
  data(){
    
    return{
      loginStatus:'',
      username:'',
      isLogin: true,
      isCenter: false,
    }
  },
  mothods:{
    
  },
  computed:{
    ...mapState("loginModule",{
      user:state=>state.user
    }),
  },
  mounted() {
    if (localStorage.getItem("wedding") != null) {
      this.isLogin = false;
      this.isCenter = true;
    }
    this.username = localStorage.getItem("wedding");
  },
};
</script>

<style scoped >
.top-box {
  width: 1247px;
  height: 111px;
  background-color: #f2f2f2;
  margin-left: 150px;
  margin-top: 50px;
  position: relative;
}
.top-img {
  width: 200px;
  height: 50px;
  position: absolute;
  top: 25%;
  left: 50px;
}
.top-img img {
  width: 100%;
  height: 100%;
}
.top-title {
  line-height: 100px;
  margin-left: -478px;
}
.top-login {
  float: right;
  margin-top: -61px;
  margin-right: 32px;
}
.user{
  padding: 10px;
  border-radius: 50px;
  background-color: #c4a4b8;
}
</style>